home *** CD-ROM | disk | FTP | other *** search
/ Enter 2005 December / enter-cd-12-2005.iso / Internet / SpamAware 4.0 / SpamAware-Setup.exe / {app} / rules / 20_ratware.cf < prev    next >
Encoding:
Text File  |  2005-06-20  |  14.1 KB  |  258 lines

  1. # SpamAssassin rules file: known spam mailers
  2. #
  3. # Sometimes these leave 'sent by mailername' fingerprints in the
  4. # headers, which provide a nice way for us to catch them.
  5. #
  6. # Please don't modify this file as your changes will be overwritten with
  7. # the next update. Use @@LOCAL_RULES_DIR@@/local.cf instead.
  8. # See 'perldoc Mail::SpamAssassin::Conf' for details.
  9. #
  10. # <@LICENSE>
  11. # Copyright 2004 Apache Software Foundation
  12. # Licensed under the Apache License, Version 2.0 (the "License");
  13. # you may not use this file except in compliance with the License.
  14. # You may obtain a copy of the License at
  15. #     http://www.apache.org/licenses/LICENSE-2.0
  16. # Unless required by applicable law or agreed to in writing, software
  17. # distributed under the License is distributed on an "AS IS" BASIS,
  18. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  19. # See the License for the specific language governing permissions and
  20. # limitations under the License.
  21. # </@LICENSE>
  22. #
  23. ###########################################################################
  24.  
  25. header RATWARE_EGROUPS        X-Mailer =~ /eGroups Message Poster/
  26. describe RATWARE_EGROUPS    Bulk email fingerprint (eGroups) found
  27. header RATWARE_HASH_2        X-Mailer =~ /^[A-Za-z0-9\._]{16,}$/
  28. describe RATWARE_HASH_2        Bulk email fingerprint (hash 2) found
  29. header RATWARE_HASH_2_V2    X-Mailer =~ /^[A-Za-z0-9\._]{14,}$/
  30. describe RATWARE_HASH_2_V2    Bulk email fingerprint (hash 2 v2) found
  31. header RATWARE_JPFREE        X-Mailer =~ /jpfree Group Mail Express/
  32. describe RATWARE_JPFREE        Bulk email fingerprint (jpfree) found
  33.  
  34. # Note that the tests which look at the "ALL" pseudoheader are slower than
  35. # the specific header.
  36. # 100% overlap with X-Stormpost-To: header, but seems wise to leave it in
  37. uri RATWARE_STORM_URI        m{^http://\S{1,100}/sp/t\.pl\?id=\d+:\d+}i
  38. describe RATWARE_STORM_URI    Bulk email fingerprint (StormPost) found
  39. header RATWARE_OE_MALFORMED    X-Mailer =~ /^Microsoft Outlook Express \d(?:\.\d+){3} \w+$/
  40. describe RATWARE_OE_MALFORMED    X-Mailer has malformed Outlook Express version
  41. header RATWARE_RCVD_LC_ESMTP    Received =~ /^from (?:(?:unknown|\d+\.\d+\.\d+\.\d+) \(\S+\)|\[\d+\.\d+\.\d+\.\d+\]) by \S+ with (?:esmtp|local|smtp); /m
  42. describe RATWARE_RCVD_LC_ESMTP    Bulk email fingerprint ('esmtp' Received) found
  43. header RATWARE_MOZ_MALFORMED    User-Agent =~ /Mozilla\/5\.0\d\d/
  44. describe RATWARE_MOZ_MALFORMED    Bulk email fingerprint (Mozilla malformed) found
  45.  
  46. ###########################################################################
  47. # Now, detect forgeries of real MUAs
  48. #
  49. # NOTE: these rules should specify version numbers!
  50.  
  51. # Dec 17 2002 jm: this means "message ID is either too old or has been
  52. # rewritten by a gateway".  Made into an eval test since meta tests cannot
  53. # (yet) chain from other meta tests.
  54. header __UNUSABLE_MSGID        eval:check_messageid_not_usable()
  55.  
  56. # AOL
  57. header __AOL_MUA        X-Mailer =~ /\bAOL\b/
  58.  
  59. # Internet Mail Service
  60. header __IMS_MUA        X-Mailer =~ /Internet Mail Service/
  61. header __IMS_MSGID        MESSAGEID =~ /^<[A-F\d]{36,40}\@\S+>$/m
  62. meta FORGED_MUA_IMS        (__IMS_MUA && !__IMS_MSGID && !__UNUSABLE_MSGID)
  63. describe FORGED_MUA_IMS        Forged mail pretending to be from IMS
  64.  
  65. # Outlook mailers often use this Message-ID
  66. header __OUTLOOK_DOLLARS_MSGID    MESSAGEID =~ /^<[0-9a-f]{12}\$[0-9a-f]{8}\$[0-9a-f]{8}\@\S+>$/m
  67.  
  68. # Outlook Express 4, 5, and 6
  69. header __OE_MUA            X-Mailer =~ /\bOutlook Express [456]\./
  70. header __OE_MSGID_1        MESSAGEID =~ /^<[A-Za-z0-9-]{7}[A-Za-z0-9]{20}\@hotmail\.com>$/m
  71. header __OE_MSGID_2        MESSAGEID =~ /^<(?:[0-9a-f]{8}|[0-9a-f]{12})\$[0-9a-f]{8}\$[0-9a-f]{8}\@\S+>$/m
  72. meta __FORGED_OE        (__OE_MUA && !__OE_MSGID_1 && !__OE_MSGID_2 && !__UNUSABLE_MSGID)
  73.  
  74. # Outlook versions that usually use "dollar signs"
  75. header __OUTLOOK_DOLLARS_MUA    X-Mailer =~ /^Microsoft Outlook(?: 8| CWS, Build 9|, Build 10)\./
  76. header __OUTLOOK_DOLLARS_OTHER    MESSAGEID =~ /^<\!\~\!/m
  77. meta __FORGED_OUTLOOK_DOLLARS    (__OUTLOOK_DOLLARS_MUA && !__OUTLOOK_DOLLARS_MSGID && !__OUTLOOK_DOLLARS_OTHER && !__IMS_MSGID && !__UNUSABLE_MSGID)
  78.  
  79. # use new meta rules to implement FORGED_MUA_OUTLOOK rule from 2.60
  80. meta FORGED_MUA_OUTLOOK        (__FORGED_OE || __FORGED_OUTLOOK_DOLLARS)
  81. describe FORGED_MUA_OUTLOOK    Forged mail pretending to be from MS Outlook
  82.  
  83. # Outlook IMO (Internet Mail Only)
  84. header __OIMO_MUA        X-Mailer =~ /Outlook IMO/
  85. header __OIMO_MSGID        MESSAGEID =~ /^<[A-P]{26}A[AB]\.[-_\w.]+\@\S+>$/m
  86. meta FORGED_MUA_OIMO        (__OIMO_MUA && !__OIMO_MSGID && !__OUTLOOK_DOLLARS_MSGID && !__UNUSABLE_MSGID)
  87. describe FORGED_MUA_OIMO    Forged mail pretending to be from MS Outlook IMO
  88.  
  89. # QUALCOMM Eudora
  90. # Note: uses X_LOOP and X_MAILING_LIST as subrules
  91. # X-Mailer: QUALCOMM Windows Eudora Version 5.0   (and 5.1)
  92. # X-Mailer: QUALCOMM Windows Eudora Version 6.0.0.22
  93. # updated to fix bugs 2047, 2598, 2654
  94. # NOTE: this is the *only* spammish Eudora MUA pattern that wasn't
  95. # ignored using __OLD_EUDORA1 and __OLD_EUDORA2 under previous rules.
  96. header __EUDORA_MUA             X-Mailer =~ /^QUALCOMM Windows Eudora (?:Pro |Light )?Version [3456]\./
  97. header __EUDORA_MSGID        MESSAGEID =~ /^<(?:\d\d?\.){3,5}\d{14}\.[a-f0-9]{8}\@\S+(?:\sport\s\d+)?>$/m
  98. header __HAS_X_LOOP        exists:X-Loop
  99. header __HAS_X_MAILING_LIST    exists:X-Mailing-List
  100. meta FORGED_MUA_EUDORA          (__EUDORA_MUA && !__EUDORA_MSGID && !__UNUSABLE_MSGID && !__HAS_X_LOOP && !__HAS_X_MAILING_LIST)
  101. describe FORGED_MUA_EUDORA    Forged mail pretending to be from Eudora
  102.   
  103. # Mar 26 2003 jm: AOL MUAs add a Received line, and do not use "real names" in
  104. # From or To headers, as far as I can see, quinlan: also see bug 1426
  105. header __AOL_FROM        From:addr =~ /\@aol\.com$/i
  106. meta FORGED_MUA_AOL_FROM    (__AOL_MUA && !__AOL_FROM)
  107. describe FORGED_MUA_AOL_FROM    Forged mail pretending to be from AOL (by From)
  108.  
  109. # From private mail with developers.  Some top tips here!
  110. header __THEBAT_MUA        X-Mailer =~ /The Bat!/
  111. header __THEBAT_MUA_V1        X-Mailer =~ /^The Bat! \(v1\./
  112. #header __THEBAT_MUA_V2        X-Mailer =~ /^The Bat! \(v2\./
  113. #header __THEBAT_MUA_V3        X-Mailer =~ /^The Bat! \(v3\./
  114. header __CTYPE_CHARSET_QUOTED    Content-Type =~ /charset=\"/i
  115. header __CTYPE_HAS_BOUNDARY    Content-Type =~ /boundary/i
  116. header __BAT_BOUNDARY        Content-Type =~ /boundary=\"?-{10}/
  117. header __MAILMAN_21             X-Mailman-Version =~ /\d/
  118. meta FORGED_MUA_THEBAT_CS    (__THEBAT_MUA && __CTYPE_CHARSET_QUOTED)
  119. meta FORGED_MUA_THEBAT_BOUN     (__THEBAT_MUA_V1 && __CTYPE_HAS_BOUNDARY && !__BAT_BOUNDARY && !__MAILMAN_21)
  120. describe FORGED_MUA_THEBAT_CS    Mail pretending to be from The Bat! (charset)
  121. describe FORGED_MUA_THEBAT_BOUN Mail pretending to be from The Bat! (boundary)
  122.  
  123. meta FORGED_OUTLOOK_HTML    (__ANY_OUTLOOK_MUA && MIME_HTML_ONLY)
  124. describe FORGED_OUTLOOK_HTML    Outlook can't send HTML message only
  125.  
  126. # bug 2525: FORGED_IMS_HTML fp'ing because new IMS *DOES* use text/html
  127. # ctype.  ARGH.  This was noted in build 5.5.2656.59, so permit builds
  128. # after that to get away with it.
  129. header __IMS_HTML_BUILDS    X-Mailer =~ /^Internet Mail Service .(?:[6789]\.|5\.[6789]|5\.5\.(?:[3456789]|2[789]|26[6789]|265[6789]))/
  130. header __IMS_HTML_RCVD        Received =~ /\bby \S+ with Internet Mail Service .(?:[6789]\.|5\.[6789]|5\.5\.(?:[3456789]|2[789]|26[6789]|265[6789]))/
  131. meta FORGED_IMS_HTML        (__IMS_MUA && MIME_HTML_ONLY && !(__IMS_HTML_BUILDS && __IMS_HTML_RCVD))
  132. describe FORGED_IMS_HTML    IMS can't send HTML message only
  133.  
  134. meta FORGED_THEBAT_HTML        (__THEBAT_MUA_V1 && MIME_HTML_ONLY)
  135. describe FORGED_THEBAT_HTML    The Bat! can't send HTML message only
  136.  
  137. # bug 1561
  138. # stronger version of USER_AGENT_APPLEMAIL
  139. # Apple Mail doesn't send text/html at all (unless it's an attachment)
  140. # It'll send text/plain, or multipart/alternative with text/plain and
  141. # text/enriched parts (boundary of "Apple-Mail-\d--\d+").  It can, however,
  142. # send a multipart/mixed with a single text/html attachment, so don't use
  143. # MIME_HTML_ONLY.
  144. # perhaps limit CTYPE to "text/plain", "multipart/alternative" with
  145. # "text/plain" and "text/enhanced", or "multipart/mixed"?
  146. header __X_MAILER_APPLEMAIL    X-Mailer =~ /^Apple Mail \(\d\.\d+\)$/
  147. header __MSGID_APPLEMAIL        Message-Id =~ /^<[0-9A-F]{8}-(?:[0-9A-F]{4}-){3}[0-9A-F]{12}\@\S+>$/
  148. header __MIME_VERSION_APPLEMAIL    Mime-Version =~ /^1\.0 \(Apple Message framework v\d+\)$/
  149. meta __USER_AGENT_APPLEMAIL    !__CTYPE_HTML && __X_MAILER_APPLEMAIL && (__MSGID_APPLEMAIL || __MIME_VERSION_APPLEMAIL)
  150.  
  151. # 2003-02-23: quinlan
  152. # some useful meta rule sub-elements
  153. body __MIME_HTML        eval:check_for_mime_html()
  154. header __CTYPE_HTML        Content-Type =~ /text\/html/i
  155. header __ANY_AOL_MUA        X-Mailer =~ /^AOL\b/
  156. header __ANY_IMS_MUA        X-Mailer =~ /^Internet Mail Service\b/
  157. header __ANY_OUTLOOK_MUA    X-Mailer =~ /^Microsoft Outlook\b/
  158. body __TAG_EXISTS_BODY        eval:html_tag_exists('body')
  159. body __TAG_EXISTS_HEAD        eval:html_tag_exists('head')
  160. body __TAG_EXISTS_HTML        eval:html_tag_exists('html')
  161. body __TAG_EXISTS_META        eval:html_tag_exists('meta')
  162.  
  163. header __ANY_QUALCOMM_MUA       X-Mailer =~ /\bQUALCOMM\b/
  164. meta FORGED_QUALCOMM_TAGS    (__ANY_QUALCOMM_MUA && __MIME_HTML && !__TAG_EXISTS_HTML)
  165. describe FORGED_QUALCOMM_TAGS    QUALCOMM mailers can't send HTML in this format
  166.  
  167. meta FORGED_AOL_TAGS        (__ANY_AOL_MUA && __MIME_HTML && !__TAG_EXISTS_HTML)
  168. describe FORGED_AOL_TAGS    AOL mailers can't send HTML in this format
  169.  
  170. meta FORGED_IMS_TAGS        (__ANY_IMS_MUA && __MIME_HTML && !(__TAG_EXISTS_HTML && __TAG_EXISTS_HEAD && __TAG_EXISTS_META && __TAG_EXISTS_BODY))
  171. describe FORGED_IMS_TAGS    IMS mailers can't send HTML in this format
  172.  
  173. meta FORGED_OUTLOOK_TAGS    (__ANY_OUTLOOK_MUA && __MIME_HTML && !(__TAG_EXISTS_HTML && __TAG_EXISTS_HEAD && __TAG_EXISTS_META && __TAG_EXISTS_BODY))
  174. describe FORGED_OUTLOOK_TAGS    Outlook can't send HTML in this format
  175.  
  176. # Send-Safe ratware (idea from Alan Curry)
  177. # random alphanumerics, separated into groups of 16 by dashes (the first
  178. # and last group may be shorter), with a lowercase "l" and a number
  179. # appended. The final number is the length of the whole string not
  180. # including the dashes or the "l<number>".  Why? I have no idea.  It's
  181. # not a tracking code - the spamware does not save it locally.
  182. #
  183. # jm: it's specifically to throw off MIME base64 encoding, to evade AOL's
  184. # filters.
  185. #
  186. # http://groups.google.com/groups?selm=atp1ip0n22%40enews3.newsguy.com
  187. rawbody RATWARE_HASH_DASH    /[a-z\d]+-([a-z\d]{16}-)+[a-z\d]+(?-i:l)\d+/i
  188. describe RATWARE_HASH_DASH    Contains a hashbuster in Send-Safe format
  189.  
  190. # spammer tool, sometimes has "netIP with HTTP;" in Received: header
  191. header RATWARE_NETIP        Content-Type =~ /boundary="--ALT--[A-Z]{4}\d/
  192. describe RATWARE_NETIP        Bulk email fingerprint (netIP) found
  193.  
  194. # this is really badly faked.  Also the spammer who uses "25250101"
  195. # for the build is a total hippie.
  196. header RATWARE_GECKO_BUILD    User-Agent =~ /Gecko\/(?!200\d\d\d\d\d)\d/
  197. describe RATWARE_GECKO_BUILD    Bulk email fingerprint (Gecko faked) found
  198.  
  199. ########################################################################
  200. # Most ratware uses message templates I would guess.
  201. # Here's two popular ones...
  202. header HDR_ORDER_MTSRIX        ALL =~ /\nMessage-ID: <\S+@\S+>\nTo: [^\n]+ <\S+>\nSubject: [^\n]+\nReferences: <\S+@\S+>\nIn-Reply-To: <\S+@\S+>\nX-Mailer: /
  203. describe HDR_ORDER_MTSRIX    Headers are in order found in spam (MTSRIX)
  204. header HDR_ORDER_TRIMRS        ALL =~ /\nTo: [^\n]+\nReferences: <\S+@\S+>\nIn-Reply-To: <\S+@\S+>\nMessage-ID: <\S+@\S+>\nReply-To: [^\n]+\nSender: /
  205. describe HDR_ORDER_TRIMRS    Headers are in order found in spam (TRIMRS)
  206.  
  207. ########################################################################
  208. # This ratware always uses a +0000 TZ in the Date header, and has a multiplicity
  209. # of From: header formats. ("From" header samples from Steven Champeon
  210. # <schampeo.hesketh.com> via the spamtools.lists.abuse.net and SPAM-L lists).
  211. #
  212. # "First Last" <firstlast_[a-z][a-z]@somedomain>        1
  213. # "First Last" <firstlast[a-z][a-z]@somedomain>         1
  214. # "First Last" <first.last[a-z][a-z]@somedomain>        1
  215. # "First Last" <first_last[a-z][a-z]@somedomain>        1
  216. # "First Last" <first_last_[a-z][a-z]@somedomain>       1
  217. # "First Last" <flast_[a-z][a-z]@somedomain>            2
  218. # "First Last" <flast[a-z][a-z]@somedomain>             2
  219. # "First Last" <f.last_[a-z][a-z]@somedomain>           2
  220. # "First Last" <f.last[a-z][a-z]@somedomain>            2
  221. # "First Last" <f_last[a-z][a-z]@somedomain>            2
  222. # "First Last" <last[a-z][a-z]@somedomain>              3
  223. # "First M. Last" <firstlast_[a-z][a-z]@somedomain>     4
  224. # "First M. Last" <firstlast[a-z][a-z]@somedomain>      4
  225. # "First M. Last" <first.m.last[a-z][a-z]@somedomain>   5
  226. # "First M. Last" <firstmlast[a-z][a-z]@somedomain>     5
  227. # "First M. Last" <firstmlast_[a-z][a-z]@somedomain>    5
  228. # "First M. Last" <fmlast_[a-z][a-z]@somedomain>        6
  229. # "First M. Last" <mlast[a-z][a-z]@somedomain>          7
  230. # "First M. Last" <m.last[a-z][a-z]@somedomain>         7
  231. header __0_TZ_1      From =~ /^\"(\w)(\w+) (\w+)\" <\1\2[\._]?\3_?[a-z][a-z]\@/i
  232. header __0_TZ_2      From =~ /^\"(\w)(\w+) (\w+)\" <\1[\._]?\3_?[a-z][a-z]\@/i
  233. header __0_TZ_3      From =~ /^\"(\w)(\w+) (\w+)\" <\3_?[a-z][a-z]\@/i
  234. header __0_TZ_4      From =~ /^\"(\w)(\w+) (\w)\. (\w+)\" <\1\2[\._]?\4_?[a-z][a-z]\@/i
  235. header __0_TZ_5      From =~ /^\"(\w)(\w+) (\w)\. (\w+)\" <\1\2[\._]?\3[\._]?\4_?[a-z][a-z]\@/i
  236. header __0_TZ_6      From =~ /^\"(\w)(\w+) (\w)\. (\w+)\" <\1\3\4_?[a-z][a-z]\@/i
  237. header __0_TZ_7      From =~ /^\"(\w)(\w+) (\w)\. (\w+)\" <\3[\._]?\4_?[a-z][a-z]\@/i
  238.  
  239. header __RATWARE_0_TZ_DATE    Date =~ / \+0000$/
  240.  
  241. meta RATWARE_ZERO_TZ           (__RATWARE_0_TZ_DATE && __CTYPE_HTML && (__0_TZ_1 || __0_TZ_2 || __0_TZ_3 || __0_TZ_4 || __0_TZ_5 || __0_TZ_6 || __0_TZ_7))
  242. describe RATWARE_ZERO_TZ    Bulk email fingerprint (+0000) found
  243.  
  244. header RCVD_BONUS_SPC_DATE    Received =~ /with SMTP;  \d\d \S\S\S /
  245. describe RCVD_BONUS_SPC_DATE    Bulk email fingerprint (bonus space) found
  246.  
  247. header X_MESSAGE_INFO        exists:X-Message-Info
  248. describe X_MESSAGE_INFO        Bulk email fingerprint (X-Message-Info) found
  249.  
  250. header RATWARE_RCVD_PF        Received =~ / \(Postfix\) with ESMTP id [^;]+\; \S+ \d+ \S+ \d+ \d+:\d+:\d+ \S+$/s
  251. describe RATWARE_RCVD_PF    Bulk email fingerprint (Received PF) found
  252.  
  253. header RATWARE_RCVD_AT        Received =~ / by \S+\@\S+ with Microsoft SMTPSVC/
  254. describe RATWARE_RCVD_AT    Bulk email fingerprint (Received @) found
  255.